<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class Chat extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('chat', function (Blueprint $table){
            $table->bigIncrements('id');
            $table->string('from_id',32)->comment('短讯来源');
            $table->string('to_id',32)->comment('短讯归属');
            $table->string('content',255)->comment('内容');
            $table->unsignedTinyInteger('type')->comment('类型|0-文字|1-图片');
            $table->string('avatar')->comment('头像');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('chat');
    }
}
